package com.ldk.springboot2021.controller;

import com.ldk.springboot2021.mapper.Order_DoorMapper;
import com.ldk.springboot2021.pojo.Door;
import com.ldk.springboot2021.pojo.Order_Door;
import com.ldk.springboot2021.service.Order_DoorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
@RequestMapping("/order")
public class Order_DoorController {
    @Autowired(required = false)
    private Order_DoorService order_doorService;

    @RequestMapping("/addOrder")
    public String addOrder(Order_Door order_door,Model model){
        return order_doorService.addOrderInfo(order_door,model);
    }
    @RequestMapping("/findAllOrders")
    public String addOrder(Model model){
        return order_doorService.findAllOrdersInfo(model);
    }
    @RequestMapping("/deleteByOrderId")
    public String deleteByOrderId(Integer orderId){
        return order_doorService.deleteByOrderId(orderId);
    }
}
